home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Newsletters / GEnieUnixNews / unxnl-04.92 < prev    next >
Text File  |  1992-12-27  |  25KB  |  616 lines

  1.                            
  2.           _  _  _   _  _   _
  3.          // // //| // // \//     N E W S
  4.         //_// // |// //  /\\     Vol 3, Issue 4 - April 1992
  5.       R o u n d T a b l e (tm)
  6.                                  
  7.    Items of interest to participants of the GEnie Unix RoundTable
  8.                               
  9.        The RoundTable SysOps are:
  10.        Andy Finkenstadt....ANDY       Rick Mobley.........LRARK
  11.        Gary Smith..........GARS       Brian Riley.........DELPHI
  12.        Mike Nolan..........M.NOLAN    All Unix SysOps.....UNIXSYSOPS$
  13.    We strongly encourage you to contact any or all of us if you have -ANY-
  14.  comments or suggestions. This is -YOUR- RoundTable. We are here to make
  15.  your participation as pleasant and beneficial as possible.
  16.               
  17.  ED: editor notes - Filling the equation 
  18.  ==
  19.  
  20.    The Unix RoundTable continues to grow into what we have every intent
  21.  of becoming the place you think of first when you think of resources
  22.  and support for your Unix or Unix-like platform. As you will see in
  23.  lead SysOp Andy's notes a help desk is starting in Chatlines, and soon
  24.  the much talked about internet gateway will be a reality. The library
  25.  continues to build at a very fast pace. We are far from being satsified
  26.  that we are fulfilling every need, no matter how hard we try. Part of
  27.  the reason we may not be doing so is that we do not see the need.
  28.  
  29.    That's where you come in. You are the reason we exist in the first
  30.  place. You are the key element. We urge you to use the FEEDBACK option
  31.  in the menu to let us know how we are doing. If you see a problem, don't
  32.  assume it will be fixed. Tell us about it. That way you will be sure we
  33.  know.
  34.  
  35.    It is also acceptible to let us know if something we are doing pleases
  36.  you. This isn't so we will have some warm, fuzzy strokes. It is so we
  37.  will know the things we are doing well, and try to emulate them in other
  38.  areas, as well.
  39.  -- Gary
  40.                     
  41.  Lead Sysop Notes                           Andrew Finkenstadt
  42.  ================                                  Chief Sysop
  43.  
  44.  It is now April 1992 and spring has arrived.  Spring cleaning is
  45.  happening in the Unix bulletin board.  New events are occuring,
  46.  and ongoing happenings continue.
  47.  
  48.  Two key items are coming up in the near future; the Unix RT hopes
  49.  to be your center for information about these products.
  50.  
  51.      *   GEnie is implementing an Internet Gateway with
  52.          X.400 mail services scheduled later on
  53.  
  54.      *   A Unix Help Desk is being established in both the
  55.          Unix RT Conference area and the GEnie Chat Lines.
  56.  
  57.  What does internet mail mean for you?  GEnie responds to the
  58.  widespread request of its members to have some kind of gateway
  59.  for mail to the "Net."  It means now you can distribute to
  60.  persons outside the GEnie mail system your internet address.  It
  61.  means that you will be able to send mail to just about anyone on
  62.  the Net.  It means greater connectivity with the world.  It may
  63.  even mean world peace.  We can always hope.
  64.  
  65.  X.400 mail is an international mail standard used for addressing
  66.  mail across disparate mail systems.  It has a very long method of
  67.  addressing which some folks find cumbersome to type.  In
  68.  addition, there are current limitations in the GE Mail product
  69.  limiting addresses to 35 characters.  These limitations are being
  70.  removed by the GE Mail programmers to allow a better integration
  71.  of X.400 with the GE Mail system.  GEnie has elected to delay the
  72.  release of X.400 connectivity until this integration is
  73.  available.
  74.  
  75.  (As of this writing no information about domain name or pricing
  76.  is available.  Stay tuned.  Some information and discussion about
  77.  the internet gateway status is available in the GEnie Users'
  78.  RoundTable on page 150;1 or 8001;1, category 5, topic 35.)
  79.  
  80.  And beginning April 16, 1992 every Tuesday night in the Unix
  81.  Roundtable Conference area (page 160;2 keywork UNIX) and every
  82.  Thursday night in the GEnie Chat Lines (page 400;4 keyword CHAT)
  83.  a Unix Help Desk will be made available for anyone to ask
  84.  Unix-related questions.  Once you have entered the chat lines,
  85.  choose channel 4 or type /CHA 4 after entering to get to the Help
  86.  Desk.  Hope to see you there!
  87.  
  88.  In addition to help desks, Chat Lines offers many enticing
  89.  features:  multi-player games such as Trivia and word games,
  90.  interesting conversation and socializing, role playing games with
  91.  the Electronic Adventures University, and a full schedule of
  92.  events every day.  Check out the weekly schedule on page 400,
  93.  item 3.
  94.  
  95.  (Side note: your Sysop, Andy, has written several of the games
  96.  used in Chat Lines.)
  97.  
  98.  Until next month, it is good to be alive!
  99.  
  100.  Upload Contest Winners for April (ANDY)
  101.  ================================
  102.  
  103.  And for yet another month, congratulations go to Eric Tremblay
  104.  [E.TREMBLAY2] for winning the Unix RT Upload Contest.  Frank
  105.  Cupo, Eric Trembley, A.Rosenbalm and Erik Uyeda have contributed
  106.  greatly toward building a resource of NeXT specific files.
  107.   Excellent work, fellas!
  108.  
  109.  And remember: you too can win up to two free days in the Unix
  110.  RoundTable on GEnie.  For details see the file CONTEST.RULES in
  111.  the library, number 2346.
  112.  
  113.  WHO short bios
  114.  ===
  115.  ..... our newest SysOp, Mike Nolan
  116.  
  117.  I first became fascinated with computers in 1967, and switched from being
  118.  an EE major to a CS major at Northwestern because I preferred programming
  119.  computers to designing them. The fascination has never faded.
  120.  
  121.  Since then, I've worked on everything from supercomputers on down, and
  122.  moved to Nebraska in 1977 to pick up an MBA and ultimately to go into
  123.  contract programming and consulting. My biggest clients are publishers,
  124.  and I'm on a national computer advisory committee for the book industry,
  125.  chairing a subcommittee on data transmission
  126.  
  127.  I've worked primarily with NCR computers since 1980, and got into Unix in
  128.  1989 because I could see that NCR was standardizing on two operating
  129.  environments, and didn't want to be just another PC hacker. (Besides which,
  130.  I've always tried to make my mark knowing how to make computers do stuff
  131.  others can't, and in Unix there are *so* many ways to flaunt the 'rules'.)
  132.  I currently write a column on NCR computers for NCR Connection, a trade
  133.  paper, and serve on the board of the NCR Unix User Group, where I am
  134.  supposed to be the newsletter editor. I'm also somewhat knowledgeable on
  135.  uucp, e-mail, and USENET, which mostly means I've struggled with it and
  136.  had a bit of success.
  137.  
  138.  FAST and NASTY, DOWN  and  DIRTY:  quick  fix scripts that do something
  139.  ================================
  140.                     
  141.  Wrapping Text in VI   (Andy)
  142.  -------------------
  143.  
  144.  Let's say you have a document which you want to rewrap to
  145.  a certain line width - perhaps to center it on an 80 character
  146.  line with a 1/2 inch margin.  This amounts to a line width
  147.  of 70 characters with 5 leading spaces.
  148.  
  149.  Step 1:  use the "J" command to combine lines of each paragraph
  150.  onto one line.
  151.  
  152.  Step 2:  now move to the beginning of the paragraph-on-one-line
  153.  and use the next keystrokes to wrap to 70 characters.
  154.  
  155.  Step 3:  repeatedly execute  "070lbi<return><esc>" until you have
  156.  run out of paragraph.  This says
  157.     0     move to beginning of line
  158.     70l   move 70 characters to the right
  159.     b     backwards one word
  160.     i     insert
  161.    <return>   split line
  162.    <esc> exit insert mode
  163.  
  164.  Step 4:  save your work.
  165.  
  166.  Putting the above string into a VI macro is left as an exercise
  167.  for the student.  An excellent reference is the file vi.macro.Z
  168.  available as file number 3020 in the Unix Roundtable.
  169.  
  170.  TUTORIALS:
  171.  =========
  172.  
  173.  
  174.                      KSH - Features and extensions
  175.                        by Brian T. Riley (DELPHI)
  176.  
  177.  
  178.          Welcome back ladies and gentlemen. This time around we
  179.  will continue with a discussion of vi command line editing and
  180.  the special characters available in that mode as well as write a
  181.  command line shell script. The first thing we need to do is
  182.  become familiar with the special characters and features
  183.  available when using vi mode with command line editing. These
  184.  are;
  185.  
  186.  # - Makes the current line a comment in history file.
  187.  
  188.  = - Lists pathnames that match current word.
  189.  
  190.  * - Replaces current word with matching file names.
  191.  
  192.  ~ - Changes case of current letter.
  193.  
  194.  v - Invokes vi program with a file consisting of current line.
  195.  
  196.  
  197.          Now, to demonstrate these features, we will use them to
  198.  write a shell script at the command line. This exercise will also
  199.  demonstrate the difference between a normal command prompt, like
  200.  MS-DOS, and a UNIX SHELL. A shell, after all, does more than just
  201.  execute our commands, it is a programming language all it's own.
  202.  
  203.          But first we need to do a little setup. Our shell script
  204.  needs to do something useful. One thing I have always found a
  205.  need for is a way to change the permissions of many files in the
  206.  current directory without having to do it manually. We will first
  207.  create several test files in a temporary directory so that we
  208.  will not risk any of our important files. To do this, execute the
  209.  following commands;
  210.  
  211.  
  212.  $cd<cr>         # this will take you to your HOME directory.
  213.  
  214.  $mkdir test<cr> # this creates the directory test
  215.  
  216.  $cd test<cr>    # this makes test our current directory
  217.  
  218.  $touch atst     # this creates the file "atst"
  219.  
  220.  $<ESC>k         # press escape and then k to retrieve the last
  221.                   command for editing
  222.  
  223.  $wrb<cr>        # this moves to the second word and replaces "a"
  224.                   in "atst" with "b" making "btst" then creates it
  225.  
  226.  $<ESC>k         # retrieves "touch btst"
  227.  
  228.  $wrc<cr>        # makes "touch btst" into "touch ctst" and
  229.                   creates it
  230.  
  231.          You should now have three files in the test directory.
  232.  Execute the following command;
  233.  
  234.  $ls -l<cr>
  235.  
  236.          and you should have something like the following.
  237.  
  238.  
  239.  -rw-r--r-- 1 brian users           0 Apr 05 08:53 atst
  240.  -rw-r--r-- 1 brian users           0 Apr 05 08:54 btst
  241.  -rw-r--r-- 1 brian users           0 Apr 05 08:55 ctst
  242.  
  243.  Don't worry if your's is not exactly like mine since we are going
  244.  to change things anyway. The part of this display that we want to
  245.  change is the first, and most cryptic, part. Namely the
  246.  "-rw-r--r--", which tells us that these are files (the first -)
  247.  and that the owner (us) has read and write permission (rw-) and
  248.  everyone else has only read permission (r--r--).
  249.  
  250.  Now for the script. Type the following commands exactly as shown
  251.  and I will explain it afterward.
  252.  
  253.  $for i in `ls ?tst`<cr>
  254.  >do echo $i<cr>
  255.  >done<cr>
  256.  
  257.  Congratulations! You have just written a command line shell
  258.  script! Now lets find out what we did. The first part
  259.  
  260.  for i in `ls ?tst`
  261.  
  262.  starts a loop using the shell command "for" and tells it to
  263.  create the environment variable "i" and assign it each of the
  264.  file names generated from the output of the command "ls ?tst"
  265.  which is substituted for the `ls ?tst`. Be sure you use the `
  266.  backquote character which is usually on the same key as the "~"
  267.  tilde. Each of the file names are used in turn in the next line
  268.  where we tell it what to "do" with it. In this case we just want
  269.  the current contents of the variable "i" to be "echo"'d to the
  270.  screen. the last line tells the loop that we are "done". Notice
  271.  that the last two lines have a ">" instead or our normal prompt?
  272.  This is known as the secondary prompt and is defined as the
  273.  value of the variable PS2.
  274.  
  275.          Unfortunately, this is not exactly what we wanted to do.
  276.  We just did this to make sure we only use the files we want and
  277.  to check our script's logic. Now that we know it works we will
  278.  change it to do what we want. Do the following;
  279.  
  280.  <ESC>k<cr>
  281.  
  282.  to retrieve our little script. You will notice that even though
  283.  we typed three lines, ksh shows us a single line with all of the
  284.  commands together, separated by "^J". This is because ksh sees
  285.  our script as a single command line instead of three separate
  286.  ones. Now that our script is on the command line and we are still
  287.  in editing mode press "v" (without the quotes) to load our script
  288.  into the full vi program. Now move the cursor to the e in echo
  289.  and type "cw" to change this word. Next type in "chmod 777" and
  290.  press <ESC>. Your script should now look something like this;
  291.  
  292.  for i in `ls ?tst`
  293.  do chmod 777 $i
  294.  done
  295.  ~
  296.  ~
  297.  ~
  298.  "/tmp/sh95.4" 3 lines, 40 characters
  299.  
  300.  
  301.  If it does, then type ":wq!" and press return to execute our
  302.  modified script. Finally, do an ls -l to display the files again
  303.  to see if it was successful. You should see this;
  304.  
  305.  
  306.  -rwxrwxrwx 1 brian users           0 Apr 05 08:53 atst
  307.  -rwxrwxrwx 1 brian users           0 Apr 05 08:54 btst
  308.  -rwxrwxrwx 1 brian users           0 Apr 05 08:55 ctst
  309.  
  310.  If not, go back and check for typing errors and try again. After
  311.  all that is the benefit of command line recall and editing! :)
  312.  
  313.          You are probably noticing that we did not use the special
  314.  characters at the beginning of this article to write our script,
  315.  so lets see how they work. Type the following;
  316.  
  317.  
  318.  $?tst<ESC>=<cr>    #this should produce
  319.  
  320.  1) atst
  321.  2) btst
  322.  3) ctst
  323.  
  324.  $at<ESC>*<cr>      #this should produce
  325.  
  326.  $atst
  327.  
  328.  $This is our first shell script<ESC>#<cr>
  329.  $cat $HISTFILE<cr>      #this should produce
  330.  
  331.  #this is our first shell script
  332.  cat $HISTFILE
  333.                  #as the last two lines of the history file
  334.  
  335.  And finally type;
  336.  
  337.  
  338.  $touch a<ESC>*<ESC>b~<cr>
  339.  
  340.  
  341.  Let me explain that one step by step. <ESC>* expands "a" to
  342.  "atst", <ESC>b moves the cursor back to the "a" is "atst", "~"
  343.  changes the "a" to "A" and the <cr> executes the new command to
  344.  create the file Atst in the current directory.
  345.  
  346.  
  347.          Well, that's all for this time, if I confused anyone I
  348.  apologize. If you would like a better explanation, come talk to
  349.  me at 9:30 EST on the real time conference where we can interact.
  350.  
  351.  
  352.  Have a good month! ::smile::
  353.  
  354.  
  355.  Shells and Subshells, a primer:   Mike Nolan (M.NOLAN)
  356.  --------------------
  357.  
  358.  As the 'new Sysop on the block', it falls to me to pick a continuing
  359.  topic for the newsletter while operating under Harris's Lament: All the
  360.  good ones are taken.  However, Gary and I have finally settled on a
  361.  series of 'reviews' of unix commands which have been ported to MS-DOS.
  362.  Watch this space!
  363.  
  364.  However, in the mean time here are some things I've learned about shells
  365.  and subshells based on a few Bourne shell scripts I wrote.  (With luck,
  366.  this won't step on Rick's toes too much, or steal his next column.)
  367.  
  368.  First some basics.  The shell interprets commands that are typed in and
  369.  either performs them directly or causes them to be performed.
  370.  
  371.  Examples of commands that the Bourne shell performs directly are variable
  372.  assignments, 'export', 'echo', and 'cd'.  Commands that are actually
  373.  executable files, usually in /bin or /usr/bin, include 'ls', and 'cat'.
  374.  
  375.  [It is one of the mysteries of unix, although a lesser mystery, that
  376.  while the bourne, c-shell and korn shell all have built-in echo command
  377.  processing, there is still an executable file named /bin/echo.]
  378.  
  379.  If the command is a file, a subshell is created, which is a copy of
  380.  the shell with the same environment settings.  If the command is a
  381.  binary of an executable command, like 'ls', it is loaded and then run.
  382.  If the command is a text file with additional shell commands, it is a
  383.  shell script, and it is also loaded into a subshell which then begins
  384.  processing the commands in the file as if they were being typed in.
  385.  
  386.  Because the subshell is only a copy of the shell, and is discarded
  387.  after the subshell is finished, variable settings and other changes
  388.  made to the subshell's environment do NOT affect the original shell, and
  389.  are, in effect, thrown away when the subshell is deleted from memory.
  390.  
  391.  Executing the following shell script would not affect the PATH command in
  392.  your shell following completion.
  393.  
  394.  #
  395.  # test1.sh, test shell script # 1 for GEnie Unix RT newsletter
  396.  #
  397.  PATH=/bin:/usr/bin:/usr/mybin
  398.  export PATH
  399.  #
  400.  # end of shell script 'test1.sh'
  401.  
  402.  There is an exception to this, called the 'dot' or '.' command.  A
  403.  subshell is NOT created when a file is executed from a '.' command.
  404.  
  405.  Thus, typing the command 'test1.sh' would not affect the shell's PATH
  406.  variable, but typing the command '. test1.sh' would.
  407.  
  408.  This assumes, of course, that 'test1.sh' has executable permission.  If
  409.  it does not, it can still be executed by invoking a shell directly,
  410.  '/bin/sh test1.sh', but then it will run in a subshell and cannot affect
  411.  your shell's environment.  You cannot do a '. /bin/sh test1.sh' to get
  412.  around this limitation.
  413.  
  414.  Each shell or subshell has its own standard input and standard output.
  415.  Within a sequence of commands, commands can be 'stacked' together
  416.  with semicolons, where each stack shares a common standard input and output,
  417.  or 'piped' together, where each subsequent command receives as its standard
  418.  input the standard output of its prececesor.  Further, commands which are
  419.  placed in parentheses are executed in a subshell.
  420.  
  421.  All this can be used to good effect to control when the standard input is
  422.  processed and where the standard output is placed.]
  423.  
  424.  The following three lines will illustrate this simply:
  425.  
  426.  echo 'this is a test'; echo 'this is also a test' | grep -c test
  427.  
  428.  echo 'this is a test'| echo 'this is also a test' | grep -c test
  429.  (echo 'this is a test'; echo 'this is also a test') | grep -c test
  430.  
  431.  The first line is executed as follows: 'echo' commands are executed directly
  432.  by the shell, so "this is a test" is placed on standard output.  The results
  433.  of the second echo are to be piped to the grep command, so the echo is
  434.  performed in a subshell which places "this is also a test" on its standard
  435.  output which is then made the standard input to another subshell, in which
  436.  the grep command is performed.  You should get the following output:
  437.  
  438.  this is a test
  439.  1
  440.  
  441.  The grep command only sees the output from the 2nd echo command, so it
  442.  only counts one "test".  This line created two subshells.
  443.  
  444.  The second line creates three subshells.  One performs the first echo
  445.  command, which places "this is a test" on its standard output, which is
  446.  then provided as the standard input to another subshell, which does the
  447.  2nd echo command.  This echo command doesn't utilize any standard input,
  448.  so "this is a test" is ignored and "this is also a test" is placed on
  449.  standard output and passed along to a third subshell.  The third subshell
  450.  counts one "test".  You should get the following output:
  451.  
  452.  1
  453.  
  454.  (Note that "this is a test" doesn't appear, because it was piped to
  455.  the 2nd subshell, which didn't do anything with it.)
  456.  
  457.  The third command starts by creating a subshell.  The first echo command
  458.  places "this is a test" on standard output, and the second echo command
  459.  places "this is also a test" on the SAME standard output.  This is then
  460.  piped to a second subshell, which sees "test" twice in its standard input.
  461.  You should get the following output:
  462.  
  463.  2
  464.  
  465.  This third command only created two subshells, because the two echo commands
  466.  shared the same subshell.
  467.  
  468.  Enough theory, on to something that might be practical.  I like to keep
  469.  track of how much time I spend online with my uucp neighbors, and what
  470.  transfer rate I'm achieving, with separate categories for daytime, evening,
  471.  and overnight.  I wrote the following awk program to process the data in my
  472.  xferstats files:
  473.  
  474.  #
  475.  # uudaily.awk
  476.  #
  477.  BEGIN {DATE=xxxxx
  478.    printf"  Date       Cnt  Inbound Outbound    Total tty07  ttya    Speed\n"
  479.    }
  480.    {
  481.    TODAY=substr($3, 2, 8)
  482.  if (substr($3,9,1) == ":") TODAY=substr($3,2,7)
  483.  if (substr($3,8,1) == ":") TODAY=substr($3,2,6)
  484.  if (substr($3,7,1) == ":") TODAY=substr($3,2,5)
  485.  len=1
  486.  if (substr(TODAY,length(TODAY)-1,1) == "-") len=0
  487.  time=substr(TODAY, length(TODAY)-len) + 0
  488.  TODAY = substr(TODAY, 1, length(TODAY) - 2 - len)
  489.  if (time < 8) TODAY=TODAY " " "NITE"
  490.  if (time > 7 && time < 17) TODAY = TODAY " " "DAY "
  491.  if (time > 16) TODAY = TODAY " " "EVE "
  492.  if (DATE != TODAY)
  493.      {
  494.  if (DATE != xxxxx)
  495.  
  496.  
  497.      {
  498.          printf "%11s%5d%9d%9d%9d%6.2f%6.2f%8.2f\n", DATE, COUNT, INBOUND,
  499.      OUTBOUND, TOTAL, TIME1/3600, TIME2/3600, TOTAL/TIME
  500.      }
  501.          DATE=TODAY
  502.     COUNT=0
  503.     TOTAL=0
  504.     INBOUND=0
  505.     OUTBOUND=0
  506.     TIME=0
  507.     TIME1=0
  508.     TIME2=0
  509.     }
  510.  if ( $7 != 0)
  511.    {
  512.     TOTAL=TOTAL+$7
  513.     TIME=TIME+$9
  514.     if ($6 == "<-") INBOUND=INBOUND+$7
  515.     if ($6 == "->") OUTBOUND=OUTBOUND+$7
  516.     #
  517.     # look for 'a' or '7' to determine if modem on /dev/ttya or /dev/tty07
  518.     #
  519.        if (substr($5,length($5)-1,1) == "7") TIME1=TIME1+$9
  520.     if (substr($5,length($5)-1,1) == "a") TIME2=TIME2+$9
  521.     COUNT++
  522.  
  523.    }
  524.    }
  525.  END
  526.   {
  527.            printf "%11s%5d%9d%9d%9d%6.2f%6.2f%8.2f\n", DATE, COUNT, INBOUND,
  528.      OUTBOUND, TOTAL, TIME1/3600, TIME2/3600, TOTAL/TIME
  529.   }
  530.  # end of uudaily.awk
  531.  
  532.  So, to run this, all I need to do is supply the xferstats data for each of
  533.  my uucp neighbors to the awk program.  Hence the following:
  534.  
  535.  #
  536.  #uudaily1.stats - summarize modem activity for uucp neighbors
  537.  #
  538.  XFER=/usr/spool/uucp/.Admin/xferstats
  539.  OLD=/usr/spool/uucp/.Old/xferstats
  540.  #
  541.  echo site1
  542.  grep site1 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk -
  543.  echo site2
  544.  grep site2 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk -
  545.  echo site3
  546.  grep site3 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk -
  547.  echo site4
  548.  grep site4 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk -
  549.  echo site5
  550.  grep site5 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk -
  551.  #
  552.  # end of uudaily.stats
  553.  
  554.  This shell script creates 11 subshells, two for each grep|awk pair, and
  555.  one for the shell script itself.
  556.  
  557.  Well, this is great if run as a cron job, but if I run it interactively
  558.  the data for the first couple of sites is likely to scroll off the top of
  559.  the page.  So, what I do is to divide this up into a series of subshells,
  560.  each of which is contained within another subshell, and then pass the
  561.  combined standard output to 'more', so that I can page through it
  562.  on screen:
  563.  
  564.  #
  565.  #uudaily2.stats - summarize modem activity for uucp neighbors, paged
  566.  #
  567.  XFER=/usr/spool/uucp/.Admin/xferstats
  568.  OLD=/usr/spool/uucp/.Old/xferstats
  569.  #
  570.  (echo site1;
  571.  (grep site1 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk - );
  572.  echo site2;
  573.  (grep site2 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk - );
  574.  echo site3;
  575.  (grep site3 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk - );
  576.  echo site4 ;
  577.  (grep site4 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk - );
  578.  echo site5;
  579.  (grep site5 $OLD $XFER |awk -f /usr/local/lib/uudaily.awk - ) ) | more
  580.  #
  581.  # end of uudaily.stats
  582.  
  583.  Note that only the output from the grep commands (to select only the
  584.  transfer records for that site) is piped to its respective awk program.
  585.  This program creates 13 different subshells in all, two for each grep|awk
  586.  pair, one for the outer layer of parentheses, one for the more command,
  587.  and one for the shells script itself.
  588.  
  589.  I hope this helped you figure out subshells as much as writing the ultimate
  590.  shell script helped me figure them out.
  591.  
  592.  ***** End of article
  593.  
  594.   ---------------    
  595.   REMINDER - This newsletter is being sent to you 'by request'. If you do
  596.  not wish to keep receiving it, e-mail a stop notice to GARS. On the other
  597.  hand, we would very much appreciate it if you would pass the word that we
  598.  do distribute this item near the tenth (10th) of the month of issue to any-
  599.  one on GEnie who requests it.
  600.    P L E A S E  also remember contributions are most welcome. Please e-mail
  601.  items and/or suggestions to GARS.
  602.                                       
  603.   (EOF)
  604.                                   
  605.  Trademark and Copyright notices:
  606.  Unix is a Trademark of UNIX System Laboratories, Inc.; GEnie, LiveWire, and
  607.  RoundTable are Trademarks of General Electric Information Services  Company;
  608.  Xenix and ms-dos are Trademarks of  Microsoft  Corporation; NeXT and NeXTstep
  609.  are Trademarks of NeXT Computer Systems, Inc., Coherent is a Trademark of 
  610.  Mark Williams Company, Sun is a Trademark of Sun Microsystems, Inc.
  611.                                   
  612.  The contents of this newsletter are copyright(c) 1992 and may be copied whole
  613.  or in part only if original  credit is included. The GEnie UNIX RoundTable is
  614.  not affiliated with AT&T or UNIX System Laboratories, Inc.
  615.  
  616.